home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 December
/
PCWorld_2007-12_cd.bin
/
domacnost a kancelar
/
autoit
/
autoit-v3-setup.exe
/
Examples
/
Helpfile
/
_SQLite_Encode.au3
< prev
next >
Wrap
Text File
|
2007-09-08
|
917b
|
23 lines
#include <SQLite.au3>
#include <SQLite.dll.au3>
Local $hFile, $vData, $sFileName, $sData, $hQuery, $aRow, $sMsg
_SQLite_Startup()
_SQLite_Open()
_SQLite_Exec(-1,"CREATE TABLE IF NOT EXISTS Test (data blob);")
$vData = Binary("Hello" & Chr(0) & "World"); = 48656C6C6F00576F726C64
$sData = _SQLite_Encode($vData)
_SQLite_Exec(-1,"INSERT INTO Test VALUES (" & $sData & ");")
$vData = Binary(Chr(0) & @CRLF); = 000D0A
$sData = _SQLite_Encode($vData)
_SQLite_Exec(-1,"INSERT INTO Test VALUES (" & $sData & ");")
$vData = Binary(Chr(0)); = 00 but this is interpreted as Number and returns 0000000000000000
$sData = _SQLite_Encode($vData)
_SQLite_Exec(-1,"INSERT INTO Test VALUES ( " & $sData & " );")
_SQLite_Query(-1,"SELECT * FROM Test;",$hQuery)
While _SQLite_FetchData ($hQuery, $aRow, 1) = $SQLITE_OK
$sMsg &= Hex($aRow[0]) & @CR
WEnd
MsgBox(0,"Result",$sMsg)
_SQLite_Close()
_SQLite_Shutdown()